#include "Item.h"
void Item::Render(){
	m_iPoint.x=render_pos_.m_Position[0]+stride_x/2;
	m_iPoint.y=render_pos_.m_Position[1]+stride_y/2;
	RenderFrameDX9(this,Resource::instance().m_Item);
}

Item::Item(){
	touch_type_=ITouchable::T_CIRCLE;
	visible=true;

}

Item::Item(ItemType _it)
{
	visible=true;
	touch_type_=ITouchable::T_CIRCLE;
	type_=_it;
	render_pos_.m_Texcoord[0]=0;
	m_fRadius=20;
	stride_x=64;
	stride_y=64;
	switch (type_)
	{
	case ITEM_RAINBOW_WING:
		render_pos_.m_Texcoord[1]=0;
		break;
	case ITEM_GOLDEN_WING:
		render_pos_.m_Texcoord[1]=stride_y;
		break;
	case ITEM_WHITE_WING:
		render_pos_.m_Texcoord[1]=stride_y*2;
		break;
	}
}
void Item::SetPosition(int _x,int _y)
{
	m_iPoint.x=global_pos_.x=_x;
	m_iPoint.y=global_pos_.y=_y;
	render_pos_.m_Position[0]=_x;
}